#pragma once
using namespace System;

#define SHOW Console::WriteLine(__FUNCTION__)

//---------------------------------------------

// ref class can derived from an class and multiple interfaces
interface class IShape
{
	void Draw();
};

ref class AScaleRC
{
public:
	virtual void ScaleRC() = 0;
};

ref struct AScaleRS
{
public:
	virtual void ScaleRS() abstract;
};

ref class MyDerivedRC: IShape, AScaleRS/*, AScaleRC*/
{
public:
	virtual void Draw() override
	{
	};
	virtual void ScaleRS() override
	{
	}
};

//--------------------------------------------

//// a sealed class cannot have any pure virtual methods
//value class AScaleVC
//{
//public:
//	virtual void Scale() abstract;
//};
//
//value struct AScaleVS
//{
//public:
//	virtual void Scale() = 0;
//};

//---------------------------------------------

//---------------------------------------------
// override & new
ref class Robot
{
public:
virtual void Greet(){SHOW;}
virtual void Walk(){SHOW;}
};
ref class HouseRobot : public Robot
{
public:
virtual void Greet() override {SHOW;}
virtual void Walk()new {SHOW;}
};
ref class SmallHouseRobot : public HouseRobot
{
public:
virtual void SayHello() = HouseRobot::Greet {SHOW;}
virtual void Walk() new {SHOW;}
virtual void Run() = HouseRobot::Walk {SHOW;}
};

void Test1()
{
	Robot^ rob = gcnew SmallHouseRobot();
	rob->Greet();
	rob->Walk();

	SmallHouseRobot^ small = dynamic_cast<SmallHouseRobot^>(rob);
	small->SayHello();
	small->Walk();
	small->Run();
}

//---------------------------------------------